Skip to content

Refactor and implement feedback on v2#1973

Merged
iMicknl merged 7 commits intov2/mainfrom
v2/second_feedback_round
Apr 6, 2026
Merged

Refactor and implement feedback on v2#1973
iMicknl merged 7 commits intov2/mainfrom
v2/second_feedback_round

Conversation

@iMicknl
Copy link
Copy Markdown
Owner

@iMicknl iMicknl commented Apr 5, 2026

Implement feedback from #1931

@iMicknl iMicknl marked this pull request as ready for review April 6, 2026 11:25
@iMicknl iMicknl requested a review from tetienne as a code owner April 6, 2026 11:25
Copilot AI review requested due to automatic review settings April 6, 2026 11:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements several V2 code-quality improvements requested in #1931, focusing on safer HTTP handling, stricter parsing, and reduced mutation side effects.

Changes:

  • Skip JSON parsing for HTTP 204 responses in _get/_post and add tests for the behavior.
  • Refactor payload preparation to camelize keys and apply abbreviations in a single pass.
  • Harden model parsing (device URL fullmatch + compiled regex; JSON event state casting with decode-error tolerance) and prevent action-queue merges from mutating caller-owned Action.commands.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pyoverkiz/client.py Return None on 204 responses and clarify get_places() documentation.
pyoverkiz/serializers.py Single-pass payload key transformation (camelize + abbreviation fix).
pyoverkiz/models.py Compiled/strict device URL parsing; tolerant JSON casting for EventState; expanded Place docstring.
pyoverkiz/action_queue.py Avoid mutating caller Action instances during merge; improve merge performance with dict indexing.
tests/test_client.py Adds coverage ensuring 204 responses don’t call response.json().
tests/test_models.py Adds coverage for strict device URL parsing and EventState JSON decode behavior (including logging).
tests/test_action_queue.py Adds coverage ensuring action-queue merging doesn’t mutate input Action.commands.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@iMicknl iMicknl merged commit 3b714ee into v2/main Apr 6, 2026
6 checks passed
@iMicknl iMicknl deleted the v2/second_feedback_round branch April 6, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants